package com.login.service;

import java.util.List;
import java.util.Map;

import net.sf.json.JSONArray;

import org.apache.log4j.Logger;

import com.login.action.fo.ManageFinaWayFO;
import com.login.dao.IManagingFinancialWayDao;

public class ManagingFinancialWayServImpl implements IManagingFinancialWayServ {
	private  IManagingFinancialWayDao daoWay;
	public static Logger log = Logger.getLogger(ManagingFinancialWayServImpl.class);


	public boolean deleteByIdString(String ids) {
		return daoWay.deleteByIdString(ids);
	}

	public boolean saveSysmenu(Map<String, Object> paraMap) {
		int num = daoWay.saveSysmenu(paraMap);
		if(num==0)
		{
		return false;
		}
		else
		{
			return true;
		}
	}

	public String searchFinaList() {
		List<ManageFinaWayFO>  list =daoWay.searchFinaWayList();
		int total = daoWay.searchFinaListNum();
		StringBuffer resultMsg = new StringBuffer("{");
		resultMsg.append("\"total\":");
		resultMsg.append(total);
		String menulist = JSONArray.fromObject(list).toString();
		resultMsg.append(",\"rows\":");
		resultMsg.append(menulist);
		resultMsg.append("}");
		return resultMsg.toString();
	}

	public void setDaoWay(IManagingFinancialWayDao daoWay) {
		this.daoWay = daoWay;
	}


	

}
